package cn.gson.fengboot.controller;


import cn.gson.fengboot.aspect.MyLog;
import cn.gson.fengboot.model.pojos.Doffer;
import cn.gson.fengboot.model.pojos.QdepFrom;
import cn.gson.fengboot.model.service.DofferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("/offer")
public class DofferController {


    @Autowired
    DofferService service;

    /*新增报价*/
    @RequestMapping("/addOffer")
    @MyLog(modul = "售前模块",desc = "新增商机报价")
    public void addOffer(@RequestBody Doffer doffer){
        service.addOffer(doffer);
    }

    @RequestMapping("/selectOfferBybusId")
    public List<Doffer> selectOfferBybusId(Integer busId,Integer offerId){
        return service.selectOfferBybusId(busId,offerId);
    }

    /*修改报价状态（已接受）*/
    @RequestMapping("/editofferAccept")
    @MyLog(modul = "售前模块",desc = "修改报价状态")
    public void editofferAccept(Integer offerId){
        service.editofferAccept(offerId);
    }


    /*查看审批人*/
    @RequestMapping("/selectapprove")
    public List<QdepFrom> selectapprove(){
        return service.selectapprove();
    }

    @RequestMapping("/verifymyoffersheme")
    public Doffer verifymyoffersheme(String offerTheme, HttpServletRequest request){
        return service.verifymyoffersheme(offerTheme,request);
    }

}
